package com.hxn.wxshake.runmain;

import cn.hutool.core.bean.BeanUtil;
import com.hxn.wxshake.utils.MapSort;
import com.hxn.wxshake.utils.RedisUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.*;

/**
 * @ClassName RedisTest
 * @Description TODO
 * @Author hxn
 * @Date 2019/8/1 17:33
 * @Version 1.0
 **/
@RunWith(SpringRunner.class)
@SpringBootTest
public class RedisTest {

    @Autowired
    private RedisUtils redisUtils;

    @Test
    public void contextLoads() {
        String name = "asd";
        Random r = new Random(1);
        for(int i=0;i<100;i++){
            redisUtils.hPut(name,"123"+ r.nextInt(10000),"12"+ r.nextInt(100));
        }
        Long aLong = redisUtils.hSize(name);
        List<Object> values = redisUtils.hValues(name);
    }

    class human{
        private String username;
        private String passwd;

        @Override
        public String toString() {
            return "human{" +
                    "username='" + username + '\'' +
                    ", passwd='" + passwd + '\'' +
                    '}';
        }

        public human(String username, String passwd) {
            this.username = username;
            this.passwd = passwd;
        }
        public human() {

        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPasswd() {
            return passwd;
        }

        public void setPasswd(String passwd) {
            this.passwd = passwd;
        }
    }
}
